var Crawler = require("crawler");

var c = new Crawler({
  maxConnections: 10,
  // This will be called for each crawled page
  callback: function (error, res, done) {
    if (error) {
      console.log(error);
    } else {
      // console.log(res)
      var $ = res.$;
      console.log($("title").text());
    }
    done();
  }
});

// Queue just one URL, with default callback
c.queue('http://www.baidu.com');
